<!DOCTYPE html>
<html lang="en" style="height:100%;">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>提现</title>

    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>

</head>
<body style="height:100%;background-color:white;position:relative;">
<div id="app">
    <div class="withdraw_frame-title">
        请输入资金密码
        <span v-myclick="closeFrame">
            <img src="../../image/big/btn_close_grey.png">
        </span>
    </div>
    <div class="withdraw_frame-input">
        <span :class="{active:hasPassword}" v-myclick="withdraw">转入</span>
        <input v-focus placeholder="资金密码" type="password" v-model="password">
    </div>
</div>
</body>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/common.js"></script>
<script src="../../script/url.js"></script>

<script>

    var vm;
    apiready = function () {
        initApp();

    };

    function initApp() {
        vm = new Vue({
            el:'#app',
            data:{
                password:'',
            },
            computed:{
                hasPassword: function(){
                    return this.password;
                },
            },
            methods:{
                withdraw:function () {
                    showProgress();
                    var withdraw_password = pinet.md5(this.password);
                    var data = {
                        member_id: getPrefs('member_id'),
                        price:api.pageParam.price,
                        withdraw_password:withdraw_password
                    };
                    var callback = function () {
                        alert('转入成功！');
                        api.sendEvent({
                            name: 'upduser',
                        });
                        api.sendEvent({
                            name: 'importcoin',
                        });
                        api.closeWin()
                    };
                    var errback = function (ret, err) {

                    };
                    pinet.post(URL.importcoin, data, callback, errback);
                },
                closeFrame:function () {
                    api.sendEvent({
                        name: 'closeimportcoin_frame',
                    });
                }
            }
        })
    }


</script>
</html>